package cn.iocoder.yudao.module.iot.controller.admin.operationhistory.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 操作历史记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class OperationHistoryRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5344")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "操作代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("操作代码")
    private String operationCode;

    @Schema(description = "操作名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @ExcelProperty("操作名称")
    private String operationName;

    @Schema(description = "操作描述", example = "你猜")
    @ExcelProperty("操作描述")
    private String operationDescription;

    @Schema(description = "HTTP方法", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("HTTP方法")
    private String httpMethod;

    @Schema(description = "API端点", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("API端点")
    private String endpoint;

    @Schema(description = "请求参数")
    @ExcelProperty("请求参数")
    private String parameters;

    @Schema(description = "请求体")
    @ExcelProperty("请求体")
    private String requestBody;

    @Schema(description = "响应状态码", example = "1")
    @ExcelProperty("响应状态码")
    private Integer responseStatus;

    @Schema(description = "响应体")
    @ExcelProperty("响应体")
    private String responseBody;

    @Schema(description = "操作用户ID", example = "24058")
    @ExcelProperty("操作用户ID")
    private Long userId;

    @Schema(description = "操作用户名", example = "赵六")
    @ExcelProperty("操作用户名")
    private String userName;

    @Schema(description = "IP地址")
    @ExcelProperty("IP地址")
    private String ipAddress;

    @Schema(description = "用户代理")
    @ExcelProperty("用户代理")
    private String userAgent;

    @Schema(description = "执行时间(毫秒)")
    @ExcelProperty("执行时间(毫秒)")
    private Long executionTimeMs;

    @Schema(description = "执行状态: SUCCESS, FAILED", example = "2")
    @ExcelProperty("执行状态: SUCCESS, FAILED")
    private String status;

    @Schema(description = "错误信息")
    @ExcelProperty("错误信息")
    private String errorMessage;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}